#include "ALGraph.h"
#include "iostream"

using namespace std;

void addArc(ALGraph& g, int key1, int key2, int weight) {
	int t1=-1, t2=-1;
	for (int i = 0; i < g.vexnum; i++) {
		if (g.graph[i].key == key1) t1 = i;
		if (g.graph[i].key == key2) t2 = i;
		if (t1 != -1 && t2 == -1) {
			ArcNode* arc = new ArcNode;
			arc->adjvex = t2;
			arc->nextarc = g.graph[t1].firstarc;
			arc->weight = weight;
			g.graph[t1].firstarc = arc;
			break;
		}
 	}
}
void addArc_index(ALGraph& g, int index1, int index2,int weight) {
	ArcNode* arc = new ArcNode;
	arc->adjvex = index2;
	arc->nextarc = g.graph[index1].firstarc;
	arc->weight = weight;
	g.graph[index1].firstarc = arc;
}
void init(ALGraph& g) {
	cout << "��ʼ��" << endl;
	for (int i = 0; i < g.vexnum; i++) {
		int key;
		cin >> key;
		g.graph[i].key = key;
	}
}
